<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
         <link href="../style/default.css" rel="stylesheet" type="text/css" />
         <title>
         	<h:outputText value="#{msgs.autentication}"/>
		 </title>
         <f:view locale="#{authenticationFrm.locale}"/>
         <f:loadBundle basename="br.utfpr.edu.language.pattern" var="msgs"/>
    </h:head>
 <body>
	<h:form id="LSLog">
	<div id="wrapper">
		<div id="wrapper-bgtop">
		<!-- start header -->
			<div id="header">
			</div>
		<hr />
		<p:growl id="erros"/> 	
		</div>
	    	 <table>
        	 	<tr>
                   	<td>
                       	<p:dialog header="#{msgs.autentication}" visible="true" closable="false" draggable="false" resizable="false" width="330">
                          <table>
                          	<tr>
                          		<td>
                          			<h:outputLabel for="user" value="#{msgs.user}" /> 
                          		</td>
                          	</tr>
                          	<tr>
                          		<td>
                          			<h:inputText id="user" onfocus="ganhouFoco(this);" onkeydown="mascara(this,maiusculo);" onblur="perdeuFoco(this);" size="30" value="#{authenticationFrm.login}"/>
                          		</td>
                          	</tr>
                          	<tr>
                          		<td>
                          			<h:outputLabel for="password" value="#{msgs.password}" />
                          		</td>
                          	</tr>
                          	<tr>
                          		<td>
                          			<h:inputSecret id="password" onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);" size="30" value="#{authenticationFrm.password}"/>
                          		</td>
                          	</tr>
                          	<tr>
                          		<td>
                          			 <p:commandButton value="#{msgs.btStart}" actionListener="#{authenticationFrm.log}" update="erros"/>
                          		</td>
                          		<td>
                       		  		<p:commandLink styleClass="link_cadastro" value="#{msgs.cadastrar}" onclick="dig1.show();"/>
                          		</td>
                          	</tr>
                          	<tr>
                       			<td>
                       		  		<p:commandLink styleClass="" value="#{msgs.esqueciMinhaSenha}" rendered="false"/>
                          		</td>
                          	</tr>
                          </table>
                      	</p:dialog>
                      	<p:dialog id="dialogCadastro" header="#{msgs.userRegistration}" widgetVar="dig1" modal="true" height="300" width="400">  
    						<table>
    							<tr>
    								<td>
    									<p:commandButton value="#{msgs.cadastrar}" actionListener="#{usuarioFrm.gravar}" update="erros,nome,email,login,senha"/>
    								</td>
    							</tr>
    							<tr>
    								<td class="rotulo">
    									<h:outputText  value="#{msgs.name}"/>
    								</td>
    								<td>
    									<p:inputText id="nome" value="#{usuarioFrm.usuario.usuario.nome}"/>
    								</td>
    							</tr>
    							<tr>
    								<td class="rotulo">
    									<h:outputText value="#{msgs.email}"/>
    								</td>
    								<td>
    									<p:inputText required="false" requiredMessage="Campo obrigatório - Email"  id="email" value="#{usuarioFrm.usuario.usuario.email}"/>
    								</td>
    							</tr>
    							<tr>
    								<td class="rotulo">
    									<h:outputText value="#{msgs.login}"/>
    								</td>
    								<td>
    									<p:inputText id="login" required="false" requiredMessage="Campo obrigatório - Login"  value="#{usuarioFrm.usuario.usuario.login}"/>
    								</td>
    							</tr>
    							<tr>
    								<td class="rotulo">
    									<h:outputText value="#{msgs.password}"/>
    								</td>
    								<td>
    									<p:password id="senha" required="false" requiredMessage="Campo obrigatório - Senha"  value="#{usuarioFrm.usuario.usuario.senha}"/>
    								</td>
    							</tr>
    						</table>
						</p:dialog> 
                   	</td>
               	</tr>
            </table> 
		</div>
	</h:form> 	
</body>
</html>

